import React from 'react';
import { inject, observer} from 'mobx-react';
import {WeaLocaleProvider} from 'ecCom';
import { Modal } from 'antd';
const getLabel = WeaLocaleProvider.getLabel;

@observer
export default class ModalConfirm extends React.Component { 
    constructor(props) {
        super(props);
        this.state = {
            ctrlHeight:600,
            scrollTop:0,
        }
    }

    componentDidMount() {
       
    }
    render(){
        const {confirmVisible} = this.props.confirmStore
        return(
            <div className="govern-modalConfirm">
                    <Modal ecId={`${this && this.props && this.props.ecId || ''}_Modal@wtsma9`}
                        cancelText={getLabel(201,"取消")}
                        okText={getLabel(16634,'确认')}
                        title={getLabel(82873,'请确认')}
                        visible={confirmVisible}
                        onOk={this.handleOk.bind(this,this.props.id,this.props.modelType)}
                        onCancel={()=>{this.props.confirmStore.handleModalConfirm(false)}}
                        >
                        <div>{this.props.content}</div>
                    </Modal>
            </div>
        )
    }
    handleOk(id,modelType){
        this.props.confirmStore.modalConfirmStore.subBtn(id,modelType);
        this.props.confirmStore.handleModalConfirm(false)
    }
}